package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mac
 * Date: 2022-09-07
 * Time: 16:33
 */
public class BookList {
    private Book[] books = new Book[5];
    private int uedSize;

    public BookList() {
        books[0] = new Book("三国演义","罗贯中",17,"小说");
        books[1] = new Book("西游记","吴承恩",47,"小说");
        books[2] = new Book("水浒传","施耐庵",37,"小说");
        this.uedSize = 3;
    }

    public Book[] getBooks() {
        return books;
    }

    public void setBooks(Book[] books) {
        this.books = books;
    }

    public int getUedSize() {
        return uedSize;
    }

    public void setUedSize(int uedSize) {
        this.uedSize = uedSize;
    }

    /**
     * 获取pos位置的一本书
     * @param pos
     * @return
     */
    public Book getPos(int pos){
        return this.books[pos];
    }

    /**
     * 设置pos下标为一本书 -> 添加一本书
     * @param pos
     * @param book
     */
    public void setBook(int pos, Book book) {
        this.books[pos] = book;
    }
}
